export default {
  // sessionStorage
  fetch(STORAGE_KEY) {
    return JSON.parse(window.localStorage.getItem(STORAGE_KEY) || null)
  },
  save(STORAGE_KEY, items) {
    window.localStorage.setItem(STORAGE_KEY, JSON.stringify(items))
  },
  remove(STORAGE_KEY) {
    window.localStorage.removeItem(STORAGE_KEY)
  },
  clear() {
    window.localStorage.clear()
  },
  // localStorage
  fetchLocal(STORAGE_KEY) {
    return JSON.parse(window.localStorage.getItem(STORAGE_KEY) || null)
  },
  saveLocal(STORAGE_KEY, items) {
    window.localStorage.setItem(STORAGE_KEY, JSON.stringify(items))
  },
  removeLocal(STORAGE_KEY) {
    window.localStorage.removeItem(STORAGE_KEY)
  },
  clearLocal() {
    window.localStorage.clear()
  }
}
